package com.example.monit.controller;

import com.example.monit.bean.ResponseRust;
import com.example.monit.service.InterfaceErrorsService;
import com.example.monit.vo.InterfaceerrorsTotalVo;
import com.example.monit.vo.InterfaceerrorsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * 接口错误
 * InterfaceErrorsController
 */
@RestController
@RequestMapping("/errors")
public class InterfaceErrorsController {

    @Autowired
    private InterfaceErrorsService interfaceErrorsService;

    /**
     * 接口错误查询
     *
     * @param querys
     * @returns
     */
    @GetMapping("/interfaceerrors")
    public ResponseRust getInterfaceErrors(InterfaceerrorsVo querys) throws IOException {
        return this.interfaceErrorsService.getInterfaceErrors(querys);
    }

    /**
     * 统计接口错误
     *
     * @param querys
     * @returns
     */
    @GetMapping("/interfaceerrorstatistics")
    public ResponseRust totalInterfaceErrorStatistics(InterfaceerrorsTotalVo querys) throws IOException {
        return this.interfaceErrorsService.totalInterfaceErrorStatistics(querys);
    }

}
